<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="author" content="wangbo">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>jsx语法</title>
</head>
<body>
    <div id="app"></div>
    <script type="text/javascript" src="../js/react.development.js"></script>
    <script type="text/javascript" src="../js/react-dom.development.js"></script>
    <script type="text/javascript" src="../js/babel.min.js"></script>
    <script type="text/babel">
    // 只有一个外围标签
        const istrue = false;
        // jsx还可用方法
        function myfn(istrue) {
            if (istrue) {
                return <p>我是p标签</p>
            } else {
                return <span>我是sapn标签</span>                
            }
        }
        const myp = <h1 id='pid' >{myfn(istrue)}</h1>
        ReactDOM.render(myp,document.getElementById('app'))
    </script>

    
</body>
</html>